const express = require("express")
const expressWs = require("express-ws")
const mongo = require("./config/db")
const cors = require("cors")
// const UserRoute = require("./router/user")
// const router = express.Router()
const websocket = require("./websocket")
const bodyParser = require("body-parser");
const app = new express()
expressWs(app)
app.use(cors())
app.use("/", websocket)
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
mongo(app)
require("./routes/user")(app)
require("./routes/admin")(app)
require("./routes/web")(app)

app.listen(3000, () => {
    console.log("server listen in 3000");
})
